// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import fastclick from 'fastclick'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import store from './store/index.js'
import ElementUI from 'element-ui'
import { Loading } from 'element-ui'
import { Message } from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import "babel-polyfill"
import './assets/style/iconfont.css'
import './assets/style/border.css'
import './assets/style/reset.css'
import 'swiper/dist/css/swiper.css'
import './assets/style/iconfont.js'
import axios from 'axios';

Vue.config.productionTip = false
fastclick.attach(document.body)
Vue.use(VueAwesomeSwiper)
Vue.use(ElementUI)
Vue.prototype.$bus = new Vue()


axios.interceptors.request.use((config) => {
         let loading = Loading.service({
         fullscreen: true,
         text: '拼命分析中，请耐心...',
         })
         return config;
          }, (err) => {
        let loading = Loading.service({});
        loading.close();
        return Promise.reject(err)
          })

axios.interceptors.response.use((response) => {
         let loading = Loading.service({
      });
        loading.close();
                  return response;
          }, (err) => {
      let loading = Loading.service({});
      loading.close();
      Message({
        message:'好像出了点小错 -_-!',
        type:'error',
        offset:250
      });
      return Promise.reject(err);    
          })

  
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>',


})
